<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<style>
			div{
				height:200px;width: 200px;border:2px solid blue ;
			}
			#num2{
				height:200px;width: 200px;border:10px solid red ;
			}
		</style>
		<script>
			function show1(){
				var d=document.getElementById("num2");
				var h=(document.defaultView.getComputedStyle(d,null)||d.currentStyle).height;
			alert("高度是："+h);
			}
			function show2(){
				var d1=document.getElementById("num2");
				var h=(document.defaultView.getComputedStyle(d,null)||d.currentStyle).height;
				d.style.height=(parseInt(h)+10)+"px";
			}
		</script>
	</head>
	<body>
		<div id="num2">
			
		</div>
		  	<input type="button" value="获得div高度" onclick="show1()" />
			<input type="button" value="给div加10个px" onclick="show2()" />
	</body>
</html>
